<!--
 * @Author: HeAo
 * @Date: 2021-10-15 14:41:33
 * @LastEditTime: 2021-10-15 14:48:37
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \web2103-2105\web2103code\3-2-Vue\day07\2-jQuery-ajax.html
 * 别乱动！
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/jquery.js"></script>
  <script src="../js/qs.js"></script>
  <script>
    const qs = Qs
    const baseUrl = 'http://47.94.46.113:8888'
    const queryData = {
      page: 1,
      pageSize: 10
    }
    const loginData = {
      username: 'admin1',
      password: 123321
    }
    const applyData = {
      name: 'tom',
      age: 12,
      telephone: 13455667788,
      gender: 'male'
    }

    $.ajax({
      url: baseUrl + '/index/category/findAll',
      method: 'get',
      success(res) {
        console.log(res);
      },
      error(error) {
        console.log(error);
      }
    })
    $.ajax({
      url: baseUrl + '/user/login',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data: JSON.stringify(loginData),
      success(res) {
        console.log(res);
      },
      error(error) {
        console.log(error);
      }
    })
  </script>
</head>

<body>

</body>

</html>